home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 49
/
Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso
/
-serious-
/
graphics
/
metaview
/
arexx-examples
/
wordworth_import_gfx.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1999-11-29
|
2KB
|
77 lines
/* Graphik Import in WordWorth mittels MetaView */
METAVIEW = ':Aminet/MetaView/MetaView' /* Please complete the path */
OPTIONS RESULTS
SIGNAL ON FAILURE
SIGNAL ON SYNTAX
/*
** Looking for our start process
*/
WWPORT = ADDRESS()
say WWPORT
if (LEFT(WWPORT, 9) ~= "WORDWORTH") then do /* not started from WordWorth */
say "Please start me from WordWorth!"
EXIT
end
/*
** Create a new Metaview process:
** first look for the allready running processes
** then the new Port will be the next one
*/
do NUMBER = 0 to 20
if (SHOW(PORTS,"METAVIEW." || NUMBER) = 0) then
leave
end
/*
** Searching for MetaView: 1. our path above,
** 2. path in env:MetaView.path
** or 3. you must have a assign "MetaView:"
*/
if (EXISTS(METAVIEW)=0) then do
if OPEN("MVVAR","env:MetaView.path","Read") then do
METAVIEW = READLN("MVVAR")
end
if (EXISTS(METAVIEW)=0) then do
METAVIEW = "MetaView:MetaView"
end
end
OPTIONS FAILAT 5 /* enable warnings for WaitForPort */
ADDRESS COMMAND
"run " || METAVIEW || " NODISPLAY"
MVPORT = "METAVIEW." || NUMBER
"WaitForPort " || MVPORT
OPTIONS FAILAT 21 /* ignore errors */
ADDRESS VALUE WWPORT
REQUESTFILE PATH "Bilder:" TITLE "Please select GFX file"
FILENAME = result
ADDRESS VALUE MVPORT
LOAD FILENAME
SAVE "t:test.cgm" AS CGM
QUIT
ADDRESS VALUE WWPORT
REQUESTNOTIFY PROMPT "Please select >t:test.cgm<."
PLACEPICTURE
EXIT
FAILURE:
ADDRESS VALUE WWPORT
REQUESTNOTIFY PROMPT "Can't find" METAVIEW "!"
EXIT
SYNTAX:
say "Error on line" SIGL ":" ERRORTEXT(RC) "!"
EXIT